import {BigNumber} from 'bignumber.js'

const vueBignumber = {}
// https://cn.vuejs.org/v2/guide/plugins.html 使用插件形式安装 directive
vueBignumber.install = Vue => {
  Vue.directive('big-number', function (el, binding) {
    const big = new BigNumber(binding.value)
    el.innerHTML = big.toFormat(2)
  })
}

export default vueBignumber
